using System;

namespace MM7.MIME.Encoding
{
	internal class Base64Encoding  : MIMEEncoding
	{
		internal override byte[] Encode(byte[] s)
		{
			string a = Convert.ToBase64String(s);
			System.Text.Encoding sss = System.Text.Encoding.GetEncoding("ISO8859-1");
			byte[] ret = sss.GetBytes(a);
			return ret;
		}

		internal override byte[] Decode(byte[] bytes)
		{
			System.Text.Encoding sss = System.Text.Encoding.GetEncoding("ISO8859-1");
			string a = sss.GetString(bytes);
			a = a.Replace("\r\n", "");
			byte[] ret = Convert.FromBase64String(a);
			return ret;
		}
		

		internal override String ContentTransferEncodingString
		{
			get {return "base64";}
		}
	}
}
